Skip to content

Conversation

@oliviarla
Copy link
Collaborator

@oliviarla oliviarla commented Nov 26, 2025

๐Ÿ”— Related Issue

  • bopCreate/bopInsert/bopInsertAndGetTrimmed/bopGet/bopMultiGet/bopSortMergeGet API ๊ตฌํ˜„์— ๋Œ€ํ•œ ์ปค๋ฐ‹์„ ์ถ”๊ฐ€ํ•ด๋‘์—ˆ์Šต๋‹ˆ๋‹ค.

โŒจ๏ธ What I did

  • ๊ตฌํ˜„ ๊ด€์  ํŠน์ด ์‚ฌํ•ญ

    • GenericTranscoder ๋Œ€์‹  CFB๋กœ๋ถ€ํ„ฐ Transcoder<Object> ํƒ€์ž…์„ ๊ฐ€์ ธ์™€ Transcoder<T> ํƒ€์ž…์œผ๋กœ ํ˜•๋ณ€ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
    • Collection ํƒ€์ž…์˜ ๊ฒฝ์šฐ Decodeํ•˜๋Š” ๋กœ์ง์„ ๋ณ„๋„ ์Šค๋ ˆ๋“œ์— ์œ„์ž„ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
  • SMGet ๊ด€๋ จ ์‚ฌํ•ญ

    • ๊ธฐ์กด์— ์—†๋˜ SMGet์—์„œ ํ•˜๋‚˜์˜ BKey๋ฅผ ์ž…๋ ฅ๋ฐ›๋Š” API๋ฅผ ์ถ”๊ฐ€ํ•˜๋А๋ผ, ๊ธฐ์กด ํƒ€์ž… ์ƒ์„ฑ์ž์— ๋Œ€ํ•œ ๋ณ€๊ฒฝ์‚ฌํ•ญ์ด ์žˆ์Šต๋‹ˆ๋‹ค.
    • SMGetResult#mergeSMGetResults ์ •์  ๋ฉ”์„œ๋“œ์— ๊ฐ’๋“ค์„ ํ•ฉ์น˜๋Š” ๋กœ์ง์„ ์œ„์ž„ํ•ฉ๋‹ˆ๋‹ค.
    • ๊ธฐ๋ณธ์ ์œผ๋กœ ์‚ฌ์šฉ์ž๊ฐ€ ์„ค์ •ํ•œ bkey range์˜ ๋ฒ”์œ„์— ๋”ฐ๋ผ bkey -> btree item key ์ˆœ์œผ๋กœ ์ •๋ ฌ๋ฉ๋‹ˆ๋‹ค. ๋‹ค๋งŒ ํ•˜๋‚˜์˜ BKey๋ฅผ ์ž…๋ ฅ๋ฐ›๋Š” API์˜ ๊ฒฝ์šฐ btree item key๊ฐ€ ํ•ญ์ƒ ascending ์ˆœ์œผ๋กœ ์ •๋ ฌ๋ฉ๋‹ˆ๋‹ค.
  • ์ƒˆ๋กœ ์ถ”๊ฐ€๋œ VO ํด๋ž˜์Šค๋“ค๊ณผ ๊ฐ ๋ฉ”์„œ๋“œ์˜ ์„œ๋ฒ„ ์‘๋‹ต ๋ณ„ ๋ฐ˜ํ™˜ ๊ฐ’์€ New Interface ์„ค๊ณ„(Notion ๋ฌธ์„œ)์— ์ •๋ฆฌ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

  • ๊ฐ€์žฅ ๊ธฐ๋ณธ์ ์ธ ๋ฉ”์„œ๋“œ๋“ค๋งŒ ์ถ”๊ฐ€ํ•˜์˜€๊ณ , bop update, bop incr ๋“ฑ์˜ API๋Š” ๋‹ค์Œ PR๋กœ ์ถ”๊ฐ€ํ•  ์˜ˆ์ •์ž…๋‹ˆ๋‹ค.

uhm0311

This comment was marked as resolved.

@jhpark816

This comment was marked as outdated.

@uhm0311

This comment was marked as outdated.

uhm0311

This comment was marked as resolved.

Copy link
Collaborator

@brido4125 brido4125 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btree api PR์— ์ „์ฒด์ ์œผ๋กœ ์•„๋ž˜์™€ ๊ฐ™์€ ์„ค๋ช… ๋ง๋ถ™์—ฌ ์ฃผ์„ธ์š”

  • as-is ์ƒํƒœ์—์„œ์˜ ๋ฐ˜ํ™˜๊ฐ’ / to-be ์ƒํƒœ์—์„œ์˜ ๋ฐ˜ํ™˜๊ฐ’
  • as-is ์ƒํƒœ์—์„œ์˜ ์˜ˆ์™ธ ์‹œ ๋ฐ˜ํ™˜ ๊ฐ’ / to-be ์ƒํƒœ์—์„œ์˜ ์˜ˆ์™ธ ์‹œ ๋ฐ˜ํ™˜๊ฐ’

์œ„ ๋ถ€๋ถ„์ด ๋‚˜์ค‘์— ํ•ด๋‹น ๊ธฐ๋Šฅ ๋ฆด๋ฆฌ์ฆˆ ํ•  ๋•Œ, ์–ด์ฐจํ”ผ ์‚ฌ์šฉ์ž์—๊ฒŒ๋„ ๊ฐ€์ด๋“œ ๋˜์–ด์•ผ ํ•  ๋‚ด์šฉ์ž…๋‹ˆ๋‹ค.
๋ฒˆ๊ฑฐ๋กญ๋”๋ผ๋„ ์ง€๊ธˆ ๋ฏธ๋ฆฌ ์ž‘์„ฑํ•œ๋‹ค๊ณ  ์ƒ๊ฐํ•˜๊ณ  ํ•ด์ฃผ์‹œ๋ฉด ๊ฐ์‚ฌํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค

@oliviarla
Copy link
Collaborator Author

@brido4125
API ๋ฉ”์„œ๋“œ๋งˆ๋‹ค javadoc์— ๋ฐ˜ํ™˜ ํƒ€์ž…์— ๋Œ€ํ•œ ๋‚ด์šฉ์„ ์ž์„ธํžˆ ์ถ”๊ฐ€ํ•ด๋‘์—ˆ์Šต๋‹ˆ๋‹ค.
as-is๊ฐ€ ArcusClient#asyncBop... ๋ง์”€ํ•˜์‹œ๋Š”๊ฒŒ ๋งž๋‹ค๋ฉด, ์ €๋Š” ์ด ๋‘˜์„ ๋น„๊ตํ•˜๋ฉด ์˜คํžˆ๋ ค ๋” ํ—ท๊ฐˆ๋ฆด ๊ฒƒ์ด๋ผ๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.
๋”ฐ๋ผ์„œ ํ˜„์žฌ ํ˜•ํƒœ์—์„œ ๋ฐ˜ํ™˜ ๊ฐ’์ด ์ ์ ˆํ•œ์ง€ ๋ฆฌ๋ทฐํ•ด์ฃผ์‹œ๋ฉด ๊ฐ์‚ฌํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. (exception์ด ๋ฐœ์ƒํ•˜๋Š” ์ƒํ™ฉ์€ ๋…ธ์…˜์— ์ •๋ฆฌ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.)

uhm0311

This comment was marked as resolved.

@oliviarla
Copy link
Collaborator Author

@brido4125 @uhm0311
๋ฆฌ๋ทฐ ๋ชจ๋‘ ๋ฐ˜์˜ํ•ด๋‘์—ˆ์Šต๋‹ˆ๋‹ค.

uhm0311
uhm0311 previously approved these changes Dec 10, 2025
@oliviarla oliviarla requested a review from brido4125 December 10, 2025 08:13
brido4125
brido4125 previously approved these changes Dec 11, 2025
jhpark816

This comment was marked as resolved.

Copy link
Collaborator

@uhm0311 uhm0311 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋ฆฌ๋ทฐ์ž…๋‹ˆ๋‹ค.

Copy link
Collaborator

@jhpark816 jhpark816 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ผ๋ถ€ ๋ฆฌ๋ทฐ

public static final class Builder {
private ElementFlagFilter eFlagFilter;
private int offset = 0;
private int count = 50;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default ๊ฐ’ 50์€ ์–ด๋–ค ๊ธฐ์ค€์œผ๋กœ ์„ค์ •ํ•œ ๊ฒƒ์ธ๊ฐ€์š”?

bop get/mget/smget ์—ฐ์‚ฐ๋งˆ๋‹ค ๋‹ฌ๋ผ์งˆ ๊ฒƒ ๊ฐ™์€๋ฐ์š”.
bop get์—์„œ๋Š” default๊ฐ€ 0์ด์–ด์•ผ ํ•˜๊ณ ,
๊ทธ ์™ธ๋Š” count ๊ฐ’์ด ์„ค์ •๋˜์–ด์•ผ ํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

๋”ฐ๋ผ์„œ, default ๊ฐ’ 0์ด ๋งž์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bop get/mget/smget ์—์„œ ๋ชจ๋‘ ์˜ค๋ฅ˜ ์—†์ด ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ์ตœ๋Œ€ ๊ฐ’์„ ์„ค์ •ํ•ด๋‘” ๊ฒƒ ๋ฟ์ž…๋‹ˆ๋‹ค.
default ๊ฐ’์„ 0์œผ๋กœ ๋‘๋ฉด mget ์‹œ์— ํ•ญ์ƒ 50์œผ๋กœ ์žฌ์ •์˜ํ•ด๋‘์–ด์•ผ ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์‚ฌ์šฉํ•  ๋•Œ ๋ถˆํŽธํ•˜์ง€ ์•Š์„๊นŒ ์‹ถ์—ˆ๋Š”๋ฐ,
0์œผ๋กœ ๋‘๋Š”๊ฒŒ ๋” ๋‚ซ๋‹ค๋ฉด ๋ณ€๊ฒฝํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

@oliviarla
Copy link
Collaborator Author

@jhpark816 ๋ฆฌ๋ทฐ ๋ฐ˜์˜ํ–ˆ์Šต๋‹ˆ๋‹ค. resolveํ•˜์ง€ ์•Š์€ ์ฝ”๋ฉ˜ํŠธ์— ๋Œ€ํ•ด์„œ๋Š” ์˜๊ฒฌ ์ฃผ์‹œ๊ฑฐ๋‚˜ ์ผ๋‹จ resolve ์ƒํƒœ๋กœ ๋ณ€๊ฒฝํ•ด์ฃผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

@jhpark816
Copy link
Collaborator

@uhm0311
๋ฆฌ๋ทฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.

@oliviarla oliviarla requested a review from uhm0311 December 24, 2025 08:05
uhm0311
uhm0311 previously approved these changes Dec 26, 2025
Copy link
Collaborator

@jhpark816 jhpark816 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ผ๋ถ€ ๋ฆฌ๋ทฐ

Copy link
Collaborator

@jhpark816 jhpark816 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ž‘์€ ๋ฆฌ๋ทฐ

private void verifyCountArg(BopGetArgs args, int maxCount) {
int count = args.getCount();
if (count <= 0 || count > maxCount) {
throw new IllegalArgumentException("Count should be between 0 to " + maxCount);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0์€ ํ—ˆ์šฉํ•˜์ง€ ์•Š์œผ๋ฏ€๋กœ, "between 1 to " ๋ผ๊ณ  ํ•ด์•ผ ํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

๋ฉ”์†Œ๋“œ ๋ช…๋„ ๋ณ€๊ฒฝ : verifyCountArg => verifyPositiveCountArg

@jhpark816
Copy link
Collaborator

@uhm0311
๋งˆ์ง€๋ง‰์œผ๋กœ ๋ฆฌ๋ทฐ๋ฅผ ํ•œ๋ฒˆ ์ •ํ™•ํ•˜๊ฒŒ ํ•ด ์ฃผ์„ธ์š”.

return collectionCreate(key, create);
}

private ArcusFuture<Boolean> collectionCreate(String key, CollectionCreate collectionCreate) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyValidator.validateKey() ํ˜ธ์ถœํ•ด์ฃผ์„ธ์š”.

return bopUpsert(key, element, null);
}

private ArcusFuture<Boolean> collectionInsert(String key,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyValidator.validateKey() ํ˜ธ์ถœํ•ด์ฃผ์„ธ์š”.

CollectionInsert<T> collectionInsert) {
AbstractArcusResult<Boolean> result = new AbstractArcusResult<>(new AtomicReference<>());
ArcusFutureImpl<Boolean> future = new ArcusFutureImpl<>(result);
CachedData co = tcForCollection.encode(collectionInsert.getValue());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

collectionInsert.setFlags(co.getFlags()) ํ˜ธ์ถœํ•ด์ฃผ์„ธ์š”.

return bopInsertOrUpsertAndGetTrimmed(key, element, true, null);
}

private ArcusFutureImpl<Map.Entry<Boolean, BTreeElement<T>>> bopInsertOrUpsertAndGetTrimmed(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyValidator.validateKey() ํ˜ธ์ถœํ•ด์ฃผ์„ธ์š”.

return insertAndGet;
}

public ArcusFuture<BTreeElement<T>> bopGet(String key, BKey bKey, BopGetArgs args) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyValidator.validateKey() ํ˜ธ์ถœํ•ด์ฃผ์„ธ์š”.

return get;
}

public ArcusFuture<BTreeElements<T>> bopGet(String key, BKey from, BKey to, BopGetArgs args) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyValidator.validateKey() ํ˜ธ์ถœํ•ด์ฃผ์„ธ์š”.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants